import { Dispatch, SetStateAction } from "react";
import { GoodsRecord } from "./../../goods/GoodsList/GoodsListType";
export interface SwiperItem {
	src: string;
	link?: string;
	primaryColor?: string;
	style?: string;
	// eslint-disable-next-line @typescript-eslint/no-explicit-any
	extra?: Record<string, any>;
}
export interface CatItem {
	name: string;
	icon: string;
	link: string;
	description?: string;
	size: string;
	borderRadius: string;
}

export interface RichTextItem {
	text: string;
}

export type ConfigurePageContentItemType = "swiper" | "cat" | "verticalGoods" | "horizontalGoods" | 'richText';

export interface GoodsItem extends Omit<GoodsRecord, "createdTime" | "updatedTime" | "status"> {
	status: boolean;
}

export interface ConfigurePageContentItem {
	type: ConfigurePageContentItemType;
	list: (SwiperItem | CatItem | GoodsItem | RichTextItem)[];
	// eslint-disable-next-line @typescript-eslint/no-explicit-any
	extra?: Record<string, any>;
	status: boolean;
	columns?: number;
	rows?: number;
}
export enum ConfigType {
	"swiper" = "轮播",
	"cat" = "分类",
	"verticalGoods" = "纵向商品列表",
	"horizontalGoods" = "横向商品列表",
	'richText' = "富文本"
}

export interface ConfigurePageContextProps {
	content: ConfigurePageContentItem[];
	setContent: Dispatch<SetStateAction<ConfigurePageContentItem[]>>;
	selectedIndex: number | null;
	setSelectedIndex: Dispatch<SetStateAction<number | null>>;
	addTypeOpen: boolean;
	setAddTypeOpen: Dispatch<SetStateAction<boolean>>;
	operateIndex: number | null;
	setOperateIndex: (index: number | null) => void;
}
